package com.guomao.IODemo;

import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;

public class Demo_Test1 {


    public static void main(String[] args) throws UnsupportedEncodingException {


//        SortedMap<String, Charset> map = Charset.availableCharsets();
//        Set<Map.Entry<String, Charset>> entries = map.entrySet();
//        for (Map.Entry<String, Charset> entry : entries) {
//            System.out.println(entry.getKey()+":"+entry.getValue());
//        }

//        String city = "厦门";

//        byte[] arr1 = city.getBytes("GBK");
        //[-49, -61, -61, -59]
//        System.out.println(Arrays.toString(arr1));

//        [-27, -114, -90, -23, -105, -88]
//        byte[] arr2 = city.getBytes("UTF-8");
//        System.out.println(Arrays.toString(arr2));

        byte[] strbs = {-27, -114, -90, -23, -105, -86};

        String s = new String(strbs, "UTF-8");
//        String s = new String(strbs, "GBK");
//        鍘﹂棬

//        System.out.println(s);

        PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out, "UTF-8"));
    }
}
